package com.woniu.ucenterservice.dao;

import com.woniu.ucenterservice.pojo.Message;
import com.woniu.ucenterservice.pojo.Type;
import com.woniu.ucenterservice.vo.MessageVo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface MessageMapper {
    int deleteByPrimaryKey(Integer messageId);

    int insert(Message record);

    int insertSelective(Message record);

    Message selectByPrimaryKey(Integer messageId);

    int updateByPrimaryKeySelective(Message record);

    int updateByPrimaryKey(Message record);

    //List<Message> selectAllMessage(Integer userId, @Param("currentPage") Integer currentPage, @Param("pageSize") Integer pageSize);
    //@Select("select message.* from message left join user_message on message.message_id=user_message.message_id where user_message.user_Id=#{userId}")
    List<Message> selectAllMessage(Integer userId, @Param("currentPage") Integer currentPage, @Param("pageSize") Integer pageSize, MessageVo vo) ;
   @Select("select type.* from type left join message on message.type_id=type.type_id where message.type_id=#{typeId} ")
    Type selectContent(Integer typeId);


    void batchDeleteUser(List<Integer> list);
}